const User = require("../module/User");

module.exports.login = async (data) => {
  if (!data.name || !data.pwd) return null;
  const reslet = await User.findOne({
    where: {
      name: data.name,
      pwd: data.pwd,
    },
  });
  if (reslet) return reslet.toJSON();
  return null;
};
